/*
 * SDLPlayerController.h
 *
 *  Created on: Jun 29, 2010
 *      Author: Ry
 */

#ifndef SDLPLAYERCONTROLLER_H_
#define SDLPLAYERCONTROLLER_H_

#include <SDL/SDL_events.h>

#include "SDLEventHandler.h"
#include "world/Object.h"
#include "world/PlayerMotionController.h"

class SDLPlayerController: public SDLEventHandler {
protected:
	PlayerMotionController *motionController;

	Object *player;

	SDLKey moveForward;
	SDLKey moveBackward;
	SDLKey strafeLeft;
	SDLKey strafeRight;

public:
	SDLPlayerController(Object *player);
	void handleEvent(SDL_Event event, float dts);
	virtual ~SDLPlayerController();

	PlayerMotionController *getMotionController() const {
		return motionController;
	}

	SDLKey getMoveBackward() const {
		return moveBackward;
	}

	SDLKey getMoveForward() const {
		return moveForward;
	}

	SDLKey getStrafeLeft() const {
		return strafeLeft;
	}

	SDLKey getStrafeRight() const {
		return strafeRight;
	}

	void setMoveBackward(SDLKey moveBackward) {
		this->moveBackward = moveBackward;
	}

	void setMoveForward(SDLKey moveForward) {
		this->moveForward = moveForward;
	}

	void setStrafeLeft(SDLKey strafeLeft) {
		this->strafeLeft = strafeLeft;
	}

	void setStrafeRight(SDLKey strafeRight) {
		this->strafeRight = strafeRight;
	}

};

#endif /* SDLPLAYERCONTROLLER_H_ */
